package com.tdkj.service.risevalue.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tdkj.dao.risevalue.IBeanPlateSMSDao;
import com.tdkj.model.risevalue.BeanPlateSMS;
import com.tdkj.service.BaseService;
import com.tdkj.service.risevalue.IBeanPlateSMSService;
            
@Component("plateSMSService")
public class BeanPlateSMSServiceImpl extends BaseService implements IBeanPlateSMSService{
	
	private  IBeanPlateSMSDao beanPlateSMSDao;
	                              
	@Resource
	public void setBeanPlateSMSDao(IBeanPlateSMSDao beanPlateSMSDao) {
		this.beanPlateSMSDao = beanPlateSMSDao;
	}

	public IBeanPlateSMSDao geBeanPlateSMSDao() {
		return beanPlateSMSDao;
	}

	@Override
	public void add(BeanPlateSMS bean) {
		beanPlateSMSDao.save(bean);
	}

	@Override
	public void delete(long id) {
		BeanPlateSMS bean = beanPlateSMSDao.findById(id, BeanPlateSMS.class);
		beanPlateSMSDao.delete(bean);
	}

	@Override
	public BeanPlateSMS get(long id) {
		BeanPlateSMS bean = beanPlateSMSDao.findById(id, BeanPlateSMS.class);
		return bean;
	}

	@Override
	public List<BeanPlateSMS> getAll() {
		return beanPlateSMSDao.findAll(BeanPlateSMS.class);
	}

	@Override
	public void update(long id, String name) {
		BeanPlateSMS bean = beanPlateSMSDao.findById(id, BeanPlateSMS.class);
		bean.setName(name);
	}




}
